package ca.concordia.pga.utils;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;

import ca.concordia.pga.models.Service;
import ca.concordia.pga.models.Concept;

public class LookAhead {
	
	public static long lookAheadTime = 0;
	
	public static void lookAhead(Map<String, Service> serviceMap, HashSet<Concept> givenConcepts) {
		long startTime = System.currentTimeMillis();
		
		for(Iterator<Service> it = serviceMap.values().iterator(); it.hasNext();) {
			if(givenConcepts.containsAll(it.next().getOutputConceptSet())) {
				it.remove();
			}
		}
		
		lookAheadTime += System.currentTimeMillis() - startTime;
	}
}